/* 全局滚动条样式优化 */

/* 主滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

::-webkit-scrollbar-corner {
  background: #f1f1f1;
}

/* 深色主题滚动条 */
.dark-theme {
  ::-webkit-scrollbar-track {
    background: #2c2c2c;
  }

  ::-webkit-scrollbar-thumb {
    background: #555;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #777;
  }

  ::-webkit-scrollbar-corner {
    background: #2c2c2c;
  }
}

/* 细滚动条样式（用于小区域） */
.thin-scrollbar {
  &::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  &::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: background 0.3s ease;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
  }
}

/* 隐藏滚动条但保持滚动功能 */
.hidden-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */

  &::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
}

/* 自定义滚动条样式（蓝色主题） */
.custom-scrollbar {
  &::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  &::-webkit-scrollbar-track {
    background: #e8f4fd;
    border-radius: 5px;
  }

  &::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #409eff 0%, #337ecc 100%);
    border-radius: 5px;
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #337ecc 0%, #2b6cb0 100%);
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
  }

  &::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #2b6cb0 0%, #2c5aa0 100%);
  }
}

/* 预览模式滚动条（深色主题） */
.preview-scrollbar {
  &::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  &::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: all 0.3s ease;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
    background-clip: content-box;
  }

  &::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.7);
    background-clip: content-box;
  }
}

/* 抽屉滚动条样式 */
.drawer-scrollbar {
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
    margin: 4px 0;
  }

  &::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    transition: background 0.3s ease;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
  }
}

/* 移动端滚动条优化 */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  .thin-scrollbar::-webkit-scrollbar {
    width: 3px;
    height: 3px;
  }

  .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .preview-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
}

/* Firefox 滚动条样式 */
* {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

.dark-theme * {
  scrollbar-color: #555 #2c2c2c;
}

.custom-scrollbar {
  scrollbar-color: #409eff #e8f4fd;
}

.preview-scrollbar {
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 滚动容器优化 */
.scroll-container {
  overflow: auto;
  scroll-behavior: smooth;
}

/* 水平滚动优化 */
.horizontal-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  
  &::-webkit-scrollbar {
    height: 8px;
  }
  
  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
  }
  
  &::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
}

/* 垂直滚动优化 */
.vertical-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  
  &::-webkit-scrollbar {
    width: 8px;
  }
}

/* 滚动阴影效果 */
.scroll-shadow {
  position: relative;
  
  &::before,
  &::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 10px;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
  }
  
  &::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
    opacity: 0;
  }
  
  &::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.8), transparent);
    opacity: 0;
  }
  
  &.scroll-top::before {
    opacity: 1;
  }
  
  &.scroll-bottom::after {
    opacity: 1;
  }
}

/* 自定义滚动指示器 */
.scroll-indicator {
  position: relative;
  
  &::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: rgba(64, 158, 255, 0.1);
    border-radius: 2px;
  }
  
  .scroll-thumb {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    background: #409eff;
    border-radius: 2px;
    transition: all 0.3s ease;
    z-index: 1;
  }
}

/* 删除确认对话框样式 */
.delete-confirm-dialog {
  .el-message-box__header {
    background: #fef0f0;
    border-bottom: 1px solid #fde2e2;
    padding: 20px 24px 15px;
  }

  .el-message-box__title {
    color: #f56c6c;
    font-weight: 600;
    font-size: 16px;
  }

  .el-message-box__content {
    padding: 20px 24px;
  }

  .el-message-box__message {
    font-size: 14px;
    line-height: 1.6;
    color: #606266;
    margin: 0;
  }

  .el-message-box__btns {
    padding: 15px 24px 20px;
    text-align: right;
  }

  .el-button--primary {
    background-color: #f56c6c;
    border-color: #f56c6c;
    font-weight: 500;
  }

  .el-button--primary:hover {
    background-color: #f78989;
    border-color: #f78989;
  }

  .el-button--primary:active {
    background-color: #dd6161;
    border-color: #dd6161;
  }

  .el-button--default {
    color: #606266;
    border-color: #dcdfe6;
  }

  .el-button--default:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
  }
}
